#include "xqat_blog.h"
#include <QPainter>
xqat_blog::xqat_blog()
{
}

void xqat_blog::set_Avatar(QLabel *label)
{
    QString file = ":/img/img/1.jpg";
    QPixmap pixmapa(file);
    QPixmap pixmap(120, 120);
    pixmap.fill(Qt::transparent);
    QPainter painter(&pixmap);
    painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
    QPainterPath path;
    path.addEllipse(0, 0, 120, 120);
    painter.setClipPath(path);
    painter.drawPixmap(0, 0, 120, 120, pixmapa);
    label->setPixmap(pixmap);
}
